package com.freewater.javabase.demo.designpattern.state;

/**
 * 初始状态（没有任何糖果）
 */
public class InitState implements State {

    private CandyMachine candyMachine;

    public InitState(CandyMachine candyMachine) {
        this.candyMachine = candyMachine;
    }

    @Override
    public void insertCoin() {
        System.out.println("you can't insert coin, there is no candies!");
    }

    @Override
    public void returnCoin() {
        System.out.println("you can't return, you haven't inserted a coin yet!");
    }

    @Override
    public void turnCrank() {
        System.out.println("you turned, but there are no candies!");
    }

    @Override
    public void dispense() {
        // do nothing
    }

    @Override
    public void printState() {
        System.out.println("***InitState***");
    }
}
